package com.group3.customer.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.group3.customer.dao.ICustomerDao;
import com.group3.customer.dao.impl.CustomerDaoImpl;
import com.group3.customer.service.ICustomerMerchantService;
import com.group3.entity.Merchant;

public class CustomerMerchantServiceImpl implements ICustomerMerchantService{
	private ICustomerDao dao = new CustomerDaoImpl();

	public List<Merchant> queryMerchantByDtId(List<String> midList, String dtId) {
		List<Merchant> merchants = new ArrayList<Merchant>();
		for(String mid:midList) {
			Merchant merchant = dao.queryMarcherByType(mid, dtId);
			if(merchant!=null) {
				merchants.add(merchant);
			}
		}
		return merchants;
	}

	public List<Merchant> queryMerchants(List<String> midList) {
		List<Merchant> merchants = new ArrayList<Merchant>();
		for(String mid : midList) {
			Merchant merchant = dao.queryMerchant(mid);
			if(merchant!=null) {
				merchants.add(merchant);
			}
		}
		return merchants;
	}

	public Merchant queryMercantByMId(String mId) {
		return dao.queryMerchant(mId);
	}
	
	
}
